<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NVTX C API Reference: Domains</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">NVTX C API Reference<span id="projectnumber">&#160;v3</span>
   </div>
   <div id="projectbrief">NVIDIA Tools Extension Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">Domains</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="memitem:ga2bbf44a48a4a46bf8900bd886524d87d" id="r_ga2bbf44a48a4a46bf8900bd886524d87d"><td class="memItemLeft" align="right" valign="top">NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___d_o_m_a_i_n_s.html#ga2bbf44a48a4a46bf8900bd886524d87d">nvtxDomainCreateA</a> (const char *name)</td></tr>
<tr class="memdesc:ga2bbf44a48a4a46bf8900bd886524d87d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a NVTX domain.  <br /></td></tr>
<tr class="separator:ga2bbf44a48a4a46bf8900bd886524d87d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac3a6ccc4e67123cf83efa27d7d5e2e9f" id="r_gac3a6ccc4e67123cf83efa27d7d5e2e9f"><td class="memItemLeft" align="right" valign="top"><a id="gac3a6ccc4e67123cf83efa27d7d5e2e9f" name="gac3a6ccc4e67123cf83efa27d7d5e2e9f"></a>
NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API&#160;</td><td class="memItemRight" valign="bottom"><b>nvtxDomainCreateW</b> (const wchar_t *name)</td></tr>
<tr class="separator:gac3a6ccc4e67123cf83efa27d7d5e2e9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga58b2508b5bbdfdd3cf30e4eaeb15a885" id="r_ga58b2508b5bbdfdd3cf30e4eaeb15a885"><td class="memItemLeft" align="right" valign="top">NVTX_DECLSPEC void NVTX_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___d_o_m_a_i_n_s.html#ga58b2508b5bbdfdd3cf30e4eaeb15a885">nvtxDomainDestroy</a> (nvtxDomainHandle_t domain)</td></tr>
<tr class="memdesc:ga58b2508b5bbdfdd3cf30e4eaeb15a885"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unregister a NVTX domain.  <br /></td></tr>
<tr class="separator:ga58b2508b5bbdfdd3cf30e4eaeb15a885"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Domains are used to group events to a developer defined scope. Middleware vendors may also scope their own events to avoid collisions with the the application developer's events, so that the application developer may inspect both parts and easily differentiate or filter them. By default all events are scoped to a global domain where NULL is provided or when using APIs provided b versions of NVTX below v2</p>
<p>Domains are intended to be typically long lived objects with the intention of logically separating events of large modules from each other such as middleware libraries from each other and the main application.</p>
<p>See <a class="el" href="index.html#DOMAINS">Domains</a> for more details </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga2bbf44a48a4a46bf8900bd886524d87d" name="ga2bbf44a48a4a46bf8900bd886524d87d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2bbf44a48a4a46bf8900bd886524d87d">&#9670;&#160;</a></span>nvtxDomainCreateA()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateA </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register a NVTX domain. </p>
<p>Domains are used to scope annotations. All NVTX_VERSION_0 and NVTX_VERSION_1 annotations are scoped to the global domain. The function nvtxDomainCreate creates a new named domain.</p>
<p>Each domain maintains its own nvtxRangePush and nvtxRangePop stack.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>- A unique string representing the domain.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A handle representing the domain.</dd></dl>
<dl class="section user"><dt>Example</dt><dd>Create a domain: <div class="fragment"><div class="line">nvtxDomainHandle_t domain = <a class="code hl_function" href="group___d_o_m_a_i_n_s.html#ga2bbf44a48a4a46bf8900bd886524d87d">nvtxDomainCreateA</a>(<span class="stringliteral">&quot;com.nvidia.nvtx.example&quot;</span>);</div>
<div class="line"> </div>
<div class="line"><a class="code hl_function" href="group___m_a_r_k_e_r_s___a_n_d___r_a_n_g_e_s.html#gaa8b4b68acc37bdaf14349b25752b26f9">nvtxMarkA</a>(<span class="stringliteral">&quot;nvtxMarkA to global domain&quot;</span>);</div>
<div class="line"> </div>
<div class="line">nvtxEventAttributes_t eventAttrib1 = {0};</div>
<div class="line">eventAttrib1.version = <a class="code hl_define" href="nv_tools_ext_8h.html#a270c1573fb02bc9f15825438913a255c">NVTX_VERSION</a>;</div>
<div class="line">eventAttrib1.size = <a class="code hl_define" href="nv_tools_ext_8h.html#a5d1913ca9009ed5aad3208c3fb7a5a0e">NVTX_EVENT_ATTRIB_STRUCT_SIZE</a>;</div>
<div class="line">eventAttrib1.message.ascii = <span class="stringliteral">&quot;nvtxDomainMarkEx to global domain&quot;</span>;</div>
<div class="line"><a class="code hl_function" href="group___m_a_r_k_e_r_s___a_n_d___r_a_n_g_e_s.html#ga9e31d7977bcd3b4e64da577908f20e70">nvtxDomainMarkEx</a>(NULL, &amp;eventAttrib1);</div>
<div class="line"> </div>
<div class="line">nvtxEventAttributes_t eventAttrib2 = {0};</div>
<div class="line">eventAttrib2.version = <a class="code hl_define" href="nv_tools_ext_8h.html#a270c1573fb02bc9f15825438913a255c">NVTX_VERSION</a>;</div>
<div class="line">eventAttrib2.size = <a class="code hl_define" href="nv_tools_ext_8h.html#a5d1913ca9009ed5aad3208c3fb7a5a0e">NVTX_EVENT_ATTRIB_STRUCT_SIZE</a>;</div>
<div class="line">eventAttrib2.message.ascii = <span class="stringliteral">&quot;nvtxDomainMarkEx to com.nvidia.nvtx.example&quot;</span>;</div>
<div class="line"><a class="code hl_function" href="group___m_a_r_k_e_r_s___a_n_d___r_a_n_g_e_s.html#ga9e31d7977bcd3b4e64da577908f20e70">nvtxDomainMarkEx</a>(domain, &amp;eventAttrib2);</div>
<div class="line"> </div>
<div class="line"><a class="code hl_function" href="group___d_o_m_a_i_n_s.html#ga58b2508b5bbdfdd3cf30e4eaeb15a885">nvtxDomainDestroy</a>(domain);</div>
<div class="ttc" id="agroup___d_o_m_a_i_n_s_html_ga2bbf44a48a4a46bf8900bd886524d87d"><div class="ttname"><a href="group___d_o_m_a_i_n_s.html#ga2bbf44a48a4a46bf8900bd886524d87d">nvtxDomainCreateA</a></div><div class="ttdeci">NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateA(const char *name)</div><div class="ttdoc">Register a NVTX domain.</div></div>
<div class="ttc" id="agroup___d_o_m_a_i_n_s_html_ga58b2508b5bbdfdd3cf30e4eaeb15a885"><div class="ttname"><a href="group___d_o_m_a_i_n_s.html#ga58b2508b5bbdfdd3cf30e4eaeb15a885">nvtxDomainDestroy</a></div><div class="ttdeci">NVTX_DECLSPEC void NVTX_API nvtxDomainDestroy(nvtxDomainHandle_t domain)</div><div class="ttdoc">Unregister a NVTX domain.</div></div>
<div class="ttc" id="agroup___m_a_r_k_e_r_s___a_n_d___r_a_n_g_e_s_html_ga9e31d7977bcd3b4e64da577908f20e70"><div class="ttname"><a href="group___m_a_r_k_e_r_s___a_n_d___r_a_n_g_e_s.html#ga9e31d7977bcd3b4e64da577908f20e70">nvtxDomainMarkEx</a></div><div class="ttdeci">NVTX_DECLSPEC void NVTX_API nvtxDomainMarkEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t *eventAttrib)</div><div class="ttdoc">Marks an instantaneous event in the application.</div></div>
<div class="ttc" id="agroup___m_a_r_k_e_r_s___a_n_d___r_a_n_g_e_s_html_gaa8b4b68acc37bdaf14349b25752b26f9"><div class="ttname"><a href="group___m_a_r_k_e_r_s___a_n_d___r_a_n_g_e_s.html#gaa8b4b68acc37bdaf14349b25752b26f9">nvtxMarkA</a></div><div class="ttdeci">NVTX_DECLSPEC void NVTX_API nvtxMarkA(const char *message)</div><div class="ttdoc">Marks an instantaneous event in the application.</div></div>
<div class="ttc" id="anv_tools_ext_8h_html_a270c1573fb02bc9f15825438913a255c"><div class="ttname"><a href="nv_tools_ext_8h.html#a270c1573fb02bc9f15825438913a255c">NVTX_VERSION</a></div><div class="ttdeci">#define NVTX_VERSION</div><div class="ttdef"><b>Definition</b> <a href="nv_tools_ext_8h_source.html#l00177">nvToolsExt.h:177</a></div></div>
<div class="ttc" id="anv_tools_ext_8h_html_a5d1913ca9009ed5aad3208c3fb7a5a0e"><div class="ttname"><a href="nv_tools_ext_8h.html#a5d1913ca9009ed5aad3208c3fb7a5a0e">NVTX_EVENT_ATTRIB_STRUCT_SIZE</a></div><div class="ttdeci">#define NVTX_EVENT_ATTRIB_STRUCT_SIZE</div><div class="ttdef"><b>Definition</b> <a href="nv_tools_ext_8h_source.html#l00396">nvToolsExt.h:396</a></div></div>
</div><!-- fragment --></dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___d_o_m_a_i_n_s.html#ga58b2508b5bbdfdd3cf30e4eaeb15a885" title="Unregister a NVTX domain.">nvtxDomainDestroy</a></dd></dl>
<dl class="section version"><dt>Version</dt><dd>NVTX_VERSION_2 </dd></dl>

</div>
</div>
<a id="ga58b2508b5bbdfdd3cf30e4eaeb15a885" name="ga58b2508b5bbdfdd3cf30e4eaeb15a885"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga58b2508b5bbdfdd3cf30e4eaeb15a885">&#9670;&#160;</a></span>nvtxDomainDestroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NVTX_DECLSPEC void NVTX_API nvtxDomainDestroy </td>
          <td>(</td>
          <td class="paramtype">nvtxDomainHandle_t&#160;</td>
          <td class="paramname"><em>domain</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unregister a NVTX domain. </p>
<p>Unregisters the domain handle and frees all domain specific resources.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">domain</td><td>- the domain handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Example</dt><dd>Destroy a domain: <div class="fragment"><div class="line">nvtxDomainHandle_t domain = <a class="code hl_function" href="group___d_o_m_a_i_n_s.html#ga2bbf44a48a4a46bf8900bd886524d87d">nvtxDomainCreateA</a>(<span class="stringliteral">&quot;com.nvidia.nvtx.example&quot;</span>);</div>
<div class="line"><span class="comment">// ...</span></div>
<div class="line"><a class="code hl_function" href="group___d_o_m_a_i_n_s.html#ga58b2508b5bbdfdd3cf30e4eaeb15a885">nvtxDomainDestroy</a>(domain);</div>
</div><!-- fragment --></dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___d_o_m_a_i_n_s.html#ga2bbf44a48a4a46bf8900bd886524d87d" title="Register a NVTX domain.">nvtxDomainCreateA</a> nvtxDomainCreateW</dd></dl>
<dl class="section version"><dt>Version</dt><dd>NVTX_VERSION_2 </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
